<template>
  <div>
    <div>{{ value2 }}</div>
    <ChildComponent :title1="value1" @childToParent="childToParent"></ChildComponent>
  </div>
</template>

<script>
import ChildComponent from "./ChildComponent.vue";
export default {
  components: {
    ChildComponent,
  },
  data() {
    return {
      value1: "我是父组件向子组件传的值",
      value2: "我是父组件自己的值",
    };
  },
  methods: {
    childToParent(value) {
      this.value2=value
  },
}
}
</script>

<style scoped></style>